package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.MeansQuestion;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/means/question")
public class QuestionController extends BaseController {

    @Autowired(required = false)
    private QuestionService questionService;




    @GetMapping("/list")
    public TableDataInfo list(MeansQuestion question)
    {
        startPage();
        List<MeansQuestion> list = questionService.selectLenderList(question);
        return getDataTable(list);
    }


    @GetMapping("/add")
    public int add(MeansQuestion question)
    {
        int list = questionService.insertLender(question);
        return list;
    }

    @GetMapping("/update")
    public int update(MeansQuestion question)
    {
        int list = questionService.updateLender(question);
        return list;
    }


    @GetMapping("/delete")
    public int delete(@RequestParam String id)
    {
        int list = questionService.deleteLender(id);
        return list;
    }

    public static void main(String[] str){

    }
}
